import cv2 as cv
filename = r'D:\photo\lena.jpg'
img = cv.imread(filename)
gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY)

cv.imshow("source image",img)
cv.imshow("GRAY",gray)
cv.waitKey()

hsv = cv.cvtColor(img,cv.COLOR_BGR2HSV)

cv.imshow("hsv src",hsv)
cv.imshow("Hue",hsv[:,:,0])
cv.imshow("Saturation",hsv[:,:,1])
cv.imshow("Value",hsv[:,:,2])
cv.waitKey()

cv.imshow("blue",img[:,:,0])
cv.imshow("green",img[:,:,1])
cv.imshow("red",img[:,:,2])

cv.waitKey()
cv.destroyAllWindows()